package com.cn.dao;

import java.sql.ResultSet;
import java.sql.SQLException;

public class Userdao {
   public boolean Banduan(String name,String pass)
   {
	   boolean flag=false;
	   BaseDao dao=new BaseDao();
       String sql="select * from user where username=? and pass=?";
       String[] params={name,pass};
       ResultSet rs=dao.executeQuery(sql, params);
       try {
		if(rs.next())
		   {
			   flag=true;
		   }
	} catch (SQLException e) {
		// TODO 自动生成的 catch 块
		e.printStackTrace();
	}
	   return flag;
   }
   public boolean Pan(String name)
   {
	   boolean flag=false;
	   BaseDao dao=new BaseDao();
       String sql="select * from user where username=?";
       String[] params={name};
       ResultSet rs=dao.executeQuery(sql, params);
       try {
		if(rs.next())
		   {
			   flag=true;
		   }
	} catch (SQLException e) {
		// TODO 自动生成的 catch 块
		e.printStackTrace();
	}
	   return flag;
   }
   public static void main(String[] args) {
	Userdao dao=new Userdao();
	System.out.println(dao.Banduan("12345", "123456"));
}
}
